package com.example.monit.controller;

import com.example.monit.bean.BasicIndicator;
import com.example.monit.bean.ResponseRust;
import com.example.monit.service.BasicIndicatorService;
import com.example.monit.vo.BasicindicatorsTotalVo;
import com.example.monit.vo.BasicindicatorsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;

@RequestMapping("/performances")
@RestController
public class BasicIndicatorController {

    @Autowired
    private BasicIndicatorService basicindicatorService;

    /**
     * 数据插入
     *
     * @param basicIndicator
     * @returns
     */
    @PostMapping("/basicindicators")
    public ResponseRust basicIndicatorLoad(@RequestBody List<BasicIndicator> basicIndicator) throws IOException {
        return this.basicindicatorService.upLoadBasicIndicator(basicIndicator);
    }


    /**
     * 基础行为查询
     * @param basicindicatorsVo
     * @return
     */
    @GetMapping("/basicindicators")
    public ResponseRust getlEasicindicatorLoad(BasicindicatorsVo basicindicatorsVo) throws IOException {
        return basicindicatorService.queryBasicIndicator(basicindicatorsVo);
    }


    /**
     * 统计接口
     */
    @GetMapping("/basicindicatorstatistics")
    public ResponseRust totalBasicIndicatorLoad(BasicindicatorsTotalVo basicindicatorsTotalVo) throws IOException {
        return basicindicatorService.totalBasicIndicator(basicindicatorsTotalVo);
    }

}
